import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter)

    const routes = [
        {
            path: '/',
            redirect: '/home',
        },
        {
            path: '/home',
            component: () => import('@home/vue')
        },
        {
            path: '/login',
            component: () => import('@login/vue'),
            children: [
                {
                    path: '',
                    redirect: 'entry'
                },
                {
                    path: 'entry',
                    name: 'entry',
                    component: () => import('@login/vue/entry-index')
                },
                {
                    path: 'registry',
                    name: 'registry',
                    component: () => import('@login/vue/registry-index')
                }
            ]
        },
        {
            path: '/sign',
            component: () => import('@sign/vue'),
            children: [
                {
                    path: "",
                    redirect: "query"
                },
                {
                    path: 'query',
                    name: 'query',
                    component: () => import('@sign/vue/query-index')
                },
                {
                    path: 'token',
                    name: 'token',
                    component: () => import('@sign/vue/token-index')
                }
            ]
        },
        {
            path: '/task',
            component: () => import('@task/vue'),
            children: [
                {
                    path: "",
                    redirect: "mytask"
                },
                {
                    path: "issue",
                    name: "issue",
                    component: () => import('@task/vue/issue-task-index')
                },
                {
                    path: "mytask",
                    name: "mytask",
                    component: () => import('@task/vue/my-task-index')
                },
                {
                    path: "task_record",
                    name: "task_record",
                    component: () => import('@task/vue/record-index')
                }
            ]
        },
        {
            path: '/profile',
            component: () => import('@prof/vue'),
            children: [
                {
                    path: "",
                    redirect: "baseinfo"
                },
                {
                    path: "baseinfo",
                    name: "baseinfo",
                    component: () => import("@prof/vue/info-index")
                },
                {
                    path: "updatepasswd",
                    name: "updatepasswd",
                    component: () => import("@prof/vue/passwd-index")
                }
            ]
        },
        {
            path: '/department',
            component: () => import('@dept/vue'),
            children: [
                {
                    path: "",
                    redirect: "manage"
                },
                {
                    path: 'manage',
                    name: 'manage',
                    component: () => import('@dept/vue/manage-index')
                },
                {
                    path: 'update',
                    name: 'update',
                    component: () => import('@dept/vue/update-index')
                }
            ]
        }
    ]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router



